package com.maxh.service.impl;

import com.maxh.mapper.CourseMapper;
import com.maxh.pojo.Course;
import com.maxh.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("CourseService")
public class CourseServiceImpl implements CourseService {

    @Autowired(required =  false)
    CourseMapper courseMapper;

    //获取课程信息
    public List<Map<String,Object>> courseList() {
        return courseMapper.courseList();
    }

    @Override
    public Boolean addCourseList(Course course) {
        return courseMapper.addCourseList(course);
    }

    @Override
    public List<Map<String, Object>> findCourse(Map<String, Object> map) {
        return courseMapper.findCourse(map);
    }

    @Override
    public Boolean deleteContent(String id) {
        return courseMapper.deleteContent(id);
    }

    @Override
    public Boolean updateCourseList(Course course) {
        return courseMapper.updateContent(course);
    }

    @Override
    public Boolean updateCourseStatus(Course course) {
        return courseMapper.updateContentStatus(course);
    }

    @Override
    public List<Map<String, Object>> curriculumList() {
       return courseMapper.findCurriculumList();
    }

    @Override
    public List searchCurriculum(Map<String, Object> map) {
        return courseMapper.findCurriculum(map);
    }

    @Override
    public List findTeacherCourse(String teacherId) {
        return courseMapper.findTeacherCourse(teacherId);
    }

    @Override
    public List<Map<String, Object>> courseListByTime() {
        return courseMapper.findCourseByTime();
    }

}
